<template>
  <div ref="border2" class="border-wrap" v-bind="$attrs">
    <svg class="dv-border-svg-container" :width="width" :height="height" fill="none">
      <polygon
        :fill="bgColor"
        :points="`
          7, 7 ${width - 7}, 7 ${width - 7}, ${height - 7} 7, ${height - 7}
        `"
      />
      <polyline
        :stroke="borderColor[0]"
        :points="`2, 2 ${width - 2} ,2 ${width - 2}, ${height - 2} 2, ${height - 2} 2, 2`"
      />
      <polyline
        :stroke="borderColor[1]"
        :points="`6, 6 ${width - 6}, 6 ${width - 6}, ${height - 6} 6, ${height - 6} 6, 6`"
      />
      <circle :fill="borderColor[0]" cx="11" cy="11" r="1" />
      <circle :fill="borderColor[0]" :cx="width - 11" cy="11" r="1" />
      <circle :fill="borderColor[0]" :cx="width - 11" :cy="height - 11" r="1" />
      <circle :fill="borderColor[0]" cx="11" :cy="height - 11" r="1" />
    </svg>
  </div>
</template>

<script>

export default {
  props: {
    bgColor: {
      type: String,
      default: () => 'transparent'
    },
    borderColor: {
      type: Array,
      default: () => ['rgb(40,98,183)', 'rgb(40,98,183,0.5)']
    },
    width: {
      type: Number,
      default: () => 0
    },
    height: {
      type: Number,
      default: () => 0
    }
  },
  data() {
    return {
      backgroundColor: 'transparent'
    }
  },
  mounted() {
    console.log(this.width)
  }

}
</script>

<style scoped="scoped" lang="less">

</style>
